package rsschart.action;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class PetExample extends HttpServlet {

	protected void service(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException {
		
		request.setAttribute("chartTitle", "Pets that Jenny Wants");
		request.setAttribute("catgName", "Animal Type");
		request.setAttribute("catgVals","Dog:Cat:Horse:Bird");
		request.setAttribute("dataSetsName","Pet Type");
		request.setAttribute("dataSetsValueLabel","Pet Count");

		List dataSetMaps = new ArrayList();
		Map dataSetMap = new HashMap();
		
		dataSetMap.put("idx", "1");
		dataSetMap.put("name", "Pets");
		dataSetMap.put("val", "3:5:2:1");
		dataSetMaps.add(dataSetMap);

		request.setAttribute("dataSetMaps",dataSetMaps);
		request.setAttribute("setCount","1");
		request.setAttribute("pointCount","4");
	
		RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/content.jsp");
		dispatcher.forward(request, response);
	
	}
	
	
	

}
